package chances.epg.entity.content;

import java.math.BigDecimal;
import java.text.NumberFormat;

import org.apache.commons.lang.StringUtils;

public class Program extends AbstractContent {
	private boolean enableStatus;//内容可用状态
	private Integer hdType;// integer防止字段为空
	private String countryOfOrigin;// 发行国家;
	private String year;// 发行年份
	private String actors;// 演员
	private String director;// 导演
	private String compere;//主持人
	private String dub;// 配音
	private String caption; // 字幕
	private String summaryMedium;// 内容简介;
	private String summaryShort;// 内容看点;
	private String tags; // 关联标签
	private String runTime; // 播出时长;
	private String displayRunTime;// 显示时长;
	private Integer freePlayTime;//免费播放时长，对于收费内容使用，单位：分钟
	private Integer suggestedPrice;// 建议价格,单位 分;
	private String score; // 评分
	private String mainFolder;// 主分类
	private String subFolder;// 子分类
	private String previewCode;//预览片
	private String priceText;
	private String externalCode;
	private String collectId;
	private String issueNo;//系列剧期号
	
	public String getActors() {
		return actors;
	}

	public String getCaption() {
		return caption;
	}

	/**
     * @return the collectId
     */
    public String getCollectId() {
        return collectId;
    }

	public String getCompere() {
		return compere;
	}

	public String getCountryOfOrigin() {
		return countryOfOrigin;
	}

	public String getDirector() {
		return director;
	}

	public String getDisplayRunTime() {
		return displayRunTime;
	}

	public String getDub() {
		return dub;
	}

	/**
     * @return the externalCode
     */
    public String getExternalCode() {
        return externalCode;
    }

	public Integer getFreePlayTime() {
		return freePlayTime;
	}

	public Integer getHdType() {
		return hdType;
	}

	public String getIssueNo() {
		return issueNo;
	}

	public String getMainFolder() {
		return mainFolder;
	}

	public String getPreviewCode() {
		return previewCode;
	}

	public String getPriceText() {
		if(null != this.suggestedPrice){
			BigDecimal b1 = new BigDecimal(this.suggestedPrice);
			BigDecimal b2 = new BigDecimal(100);
			double price = b1.divide(b2, 2, BigDecimal.ROUND_HALF_UP).floatValue();
	
			NumberFormat nbf = NumberFormat.getInstance();
			nbf.setMinimumFractionDigits(2);
			this.priceText = nbf.format(price);
		}
		return priceText;
	}

	public String getRunTime() {
		return runTime;
	}

	public String getSubFolder() {
		return subFolder;
	}

	public Integer getSuggestedPrice() {
		return suggestedPrice;
	}

	public String getSummaryMedium() {
		return summaryMedium;
	}

	public String getSummaryShort() {
		return summaryShort;
	}

	public String getTags() {
		return tags;
	}

	public String getYear() {
		return year;
	}
	
	public boolean isEnableStatus() {
		return enableStatus;
	}

	public boolean isNew() {
        if (StringUtils.isBlank(this.collectId)) {
            return false;
        }
        return collectId.equals("3");
    }

	public void setActors(String actors) {
		this.actors = actors;
	}

	public void setCaption(String caption) {
		this.caption = caption;
	}

	/**
     * @param collectId the collectId to set
     */
    public void setCollectId(String collectId) {
        this.collectId = collectId;
    }

	public void setCompere(String compere) {
		this.compere = compere;
	}

	public void setCountryOfOrigin(String countryOfOrigin) {
		this.countryOfOrigin = countryOfOrigin;
	}

	public void setDirector(String director) {
		this.director = director;
	}

	public void setDisplayRunTime(String displayRunTime) {
		this.displayRunTime = displayRunTime;
	}

	public void setDub(String dub) {
		this.dub = dub;
	}

	public void setEnableStatus(boolean enableStatus) {
		this.enableStatus = enableStatus;
	}

    /**
     * @param externalCode the externalCode to set
     */
    public void setExternalCode(String externalCode) {
        this.externalCode = externalCode;
    }

    public void setFreePlayTime(Integer freePlayTime) {
		this.freePlayTime = freePlayTime;
	}

    public void setHdType(Integer hdType) {
		this.hdType = hdType;
	}

    public void setIssueNo(String issueNo) {
		this.issueNo = issueNo;
    }

	public String getScore() {
		return score;
	}

	public void setScore(String score) {
		this.score = score;
	}

	public void setMainFolder(String mainFolder) {
		this.mainFolder = mainFolder;
	}

	public void setPreviewCode(String previewCode) {
		this.previewCode = previewCode;
	}

	public void setPriceText(String priceText) {
		this.priceText = priceText;
	}

	public void setRunTime(String runTime) {
		this.runTime = runTime;
	}

	public void setSubFolder(String subFolder) {
		this.subFolder = subFolder;
	}

	public void setSuggestedPrice(Integer suggestedPrice) {
		this.suggestedPrice = suggestedPrice;
	}

	public void setSummaryMedium(String summaryMedium) {
		this.summaryMedium = summaryMedium;
	}

	public void setSummaryShort(String summaryShort) {
		this.summaryShort = summaryShort;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public void setYear(String year) {
		this.year = year;
	}
}
